﻿using System;
using Volo.Abp.Modularity;
using Volo.Abp.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

namespace MyabpDDD.Demo.EntityFrameworkCore
{
    [DependsOn(typeof(AbpEntityFrameworkCoreModule),typeof(MyabpDDDDemoDomainModule))]
    public class MyabpDDDDemoEntityFrameworkCoreModule:AbpModule
    {
        //注册
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var service = context.Services;
            //注册上下文件类到IOC
            service.AddAbpDbContext<MyDbContext>(opt =>
            {
                opt.AddDefaultRepositories(true);//启用ABP仓储 注意，要在注入口项目中使用Autoface
            });
            Configure<AbpDbContextOptions>(opt =>
            {
                opt.UseSqlServer();//数据库使用的时SQL server
            });
        }

        //管理管道
    }
}
